import org.junit.Test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 * @auther yangdong
 * @create 2020-05-13
 */

public class PropertiesTest {
    FileInputStream fis;
    Properties pro=new Properties();
    @Test
    //Properties:常用来处理配置文件。key和value都是String类型
    public void testPro() {
        {
            try {
                fis = new FileInputStream("src/jdbc.properties");
                pro.load(fis);
                System.out.println(pro.getProperty("name"));
                System.out.println(pro.getProperty("love"));
                System.out.println(pro.getProperty("age"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
